var PageIndex = new (function() {
	var UI = {
		form: '#form-new-test'
	}
	
	function getValRadio(nodelist) {
		var value = "";
		for (var i = 0; i < nodelist.length; i++) {
			if (nodelist[i].checked) {
				value = nodelist[i].value;
			}
		}
		return value;
	};
	
	function onSubmitTest(e) {
		var type = getValRadio($("form-new-test").type);
		JapWord.Test.createNewTest(type, "normal");
		window.location = "test.html";
		e.stop();
	}
	
	this.init = function() {
		UI = JapWord.Page.initUI(UI);
		UI.form.observe("submit", onSubmitTest);
	}
	
	document.observe("dom:loaded",this.init);
	
});